#include <REGX52.H>
#include "Delay.h"
#include <INTRINS.h>
sbit  Buzzer = P1^5;//定义蜂鸣器IO口
/**
  * @brief 蜂鸣器延时函数500us 
  * @param  
  * @retval 
  */
void Buzzer_Delay500us()		//@12.000MHz
{
	unsigned char i;

	_nop_();
	i = 247;
	while (--i);
}

/**
  * @brief  蜂鸣器发声
  * @param  ms  发声的时常
  * @retval 无
  */
void Buzzer_Time(unsigned int ms)
 {
	 unsigned int i;
   for(i =0;i<ms*2;i++)
				{
				  Buzzer=!Buzzer;
					Buzzer_Delay500us();
				}

 }
